local duoshi = fk.CreateSkill {
  name = "lvshi__duoshi",
  tags = {"ready_skill"}
}

Fk:loadTranslationTable{
  ["lvshi__duoshi"] = "度势",
  [":lvshi__duoshi"] = "<a href='diy_ready_skill'>蓄势技</a>，你可将一张红色牌当【以逸待劳】使用。",
  ["$lvshi__duoshi"] = "审时度势，切不可轻动。",
}
local DIY = require "packages/diy_utility/diy_utility"
duoshi:addEffect("viewas", {
  anim_type = "control",
  pattern = "await_exhausted",
  mute_card = true,
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).color == Card.Red
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local c = Fk:cloneCard("lvshi__await_exhausted")
    c.skillName = duoshi.name
    c:addSubcard(cards[1])
    return c
  end,
  enabled_at_play = function(self, player)
    return not DIY.isReadying(player, duoshi.name)
  end,
  enabled_at_response = function (self, player, response)
    return not response and not DIY.isReadying(player, duoshi.name)
  end
})

return duoshi